/*
 * Copyright (C), 2002-2017, roy 学习代码
 * FileName: TableDto.java
 * Author:   roy
 * Date:     2017年1月5日 下午8:45:07
 * Description: //模块目的、功能描述      
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名             修改时间            版本号                  描述
 */
package com.roy.roycodegenerator.service.generator.dto;

import java.util.List;

import com.roy.roycodegenerator.common.consts.CamelToUnderScoreTools;

/**
 * 表相关生成器<br>
 * 〈功能详细描述〉
 *
 * @author roy
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */
public class TableDto {
    /**
     * 基础包路径
     */
    private String packageBasePatch;
    /**
     * controller基础包路径
     */
    private String packageControllerPatch;
    /**
     * service基础包路径
     */
    private String packageServicePatch;
    /**
     * 作者信息
     */
    private String author;

    /**
     * Entity基础包路径
     */
    private String packageEntityPatch;

    /**
     * Entity基础包路径
     */
    private String packageDmoPatch;

    /**
     * 表名
     */
    private String tableName;
    /**
     * 对应的类名
     */
    private String className;
    /**
     * 对应的参数名
     */
    private String entityParamName;

    /**
     * 命名空间
     */
    private String nameSpace;

    /**
     * 字段信息列表
     */
    private List<ColumnDto> columns;
    /**
     * 需要导入的额外jar包
     */
    private List<String> commonPackage;

    /**
     * @return the tableName
     */
    public String getTableName() {
        return tableName;
    }

    /**
     * @param tableName the tableName to set
     */
    public void setTableName(String tableName) {
        this.tableName = tableName;
        // 设置类名
        if (tableName.startsWith("tb_") || tableName.startsWith("TB_")) {
            this.entityParamName = CamelToUnderScoreTools.camelName(tableName.substring(3));
            this.className = entityParamName.substring(0, 1).toUpperCase() + entityParamName.substring(1);
        } else {
            this.entityParamName = CamelToUnderScoreTools.camelName(tableName);
            this.className = entityParamName.substring(0, 1).toUpperCase() + entityParamName.substring(1);
        }
    }

    /**
     * @return the className
     */
    public String getClassName() {
        return className;
    }

    /**
     * @param className the className to set
     */
    public void setClassName(String className) {
        this.className = className;
    }

    /**
     * @return the packageBasePatch
     */
    public String getPackageBasePatch() {
        return packageBasePatch;
    }

    /**
     * @param packageBasePatch the packageBasePatch to set
     */
    public void setPackageBasePatch(String packageBasePatch) {
        this.packageBasePatch = packageBasePatch;
    }

    /**
     * @return the columns
     */
    public List<ColumnDto> getColumns() {
        return columns;
    }

    /**
     * @param columns the columns to set
     */
    public void setColumns(List<ColumnDto> columns) {
        this.columns = columns;
    }

    /**
     * @return the entityParamName
     */
    public String getEntityParamName() {
        return entityParamName;
    }

    /**
     * @param entityParamName the entityParamName to set
     */
    public void setEntityParamName(String entityParamName) {
        this.entityParamName = entityParamName;
    }

    /**
     * @return the packageServicePatch
     */
    public String getPackageServicePatch() {
        return packageServicePatch;
    }

    /**
     * @param packageServicePatch the packageServicePatch to set
     */
    public void setPackageServicePatch(String packageServicePatch) {
        this.packageServicePatch = packageServicePatch;
    }

    /**
     * @return the packageControllerPatch
     */
    public String getPackageControllerPatch() {
        return packageControllerPatch;
    }

    /**
     * @param packageControllerPatch the packageControllerPatch to set
     */
    public void setPackageControllerPatch(String packageControllerPatch) {
        this.packageControllerPatch = packageControllerPatch;
    }

    /**
     * @return the packageEntityPatch
     */
    public String getPackageEntityPatch() {
        return packageEntityPatch;
    }

    /**
     * @param packageEntityPatch the packageEntityPatch to set
     */
    public void setPackageEntityPatch(String packageEntityPatch) {
        this.packageEntityPatch = packageEntityPatch;
    }

    /**
     * @return the packageDmoPatch
     */
    public String getPackageDmoPatch() {
        return packageDmoPatch;
    }

    /**
     * @param packageDmoPatch the packageDmoPatch to set
     */
    public void setPackageDmoPatch(String packageDmoPatch) {
        this.packageDmoPatch = packageDmoPatch;
    }

    /**
     * @return the author
     */
    public String getAuthor() {
        return author;
    }

    /**
     * @param author the author to set
     */
    public void setAuthor(String author) {
        this.author = author;
    }

    /**
     * @return the commonPackage
     */
    public List<String> getCommonPackage() {
        return commonPackage;
    }

    /**
     * @param commonPackage the commonPackage to set
     */
    public void setCommonPackage(List<String> commonPackage) {
        this.commonPackage = commonPackage;
    }

    /**
     * @return the nameSpace
     */
    public String getNameSpace() {
        return nameSpace;
    }

    /**
     * @param nameSpace the nameSpace to set
     */
    public void setNameSpace(String nameSpace) {
        this.nameSpace = nameSpace;
    }

    /*
     * (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "TableDto [packageBasePatch=" + packageBasePatch + ", packageServicePatch=" + packageServicePatch
                + ", packageControllerPatch=" + packageControllerPatch + ", packageEntityPatch=" + packageEntityPatch
                + ", packageDmoPatch=" + packageDmoPatch + ", tableName=" + tableName + ", className=" + className
                + ", entityParamName=" + entityParamName + ", columns=" + columns + "]";
    }

}
